﻿using System;

namespace HslCommunication.Core.IMessage
{
	/// <summary>
	/// 倍福的ADS协议的信息
	/// </summary>
	// Token: 0x0200014B RID: 331
	public class AdsNetMessage : INetMessage
	{
		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ProtocolHeadBytesLength" />
		// Token: 0x170005AB RID: 1451
		// (get) Token: 0x06001CB3 RID: 7347 RVA: 0x0008CC1C File Offset: 0x0008AE1C
		public int ProtocolHeadBytesLength
		{
			get
			{
				return 6;
			}
		}

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.HeadBytes" />
		// Token: 0x170005AC RID: 1452
		// (get) Token: 0x06001CB4 RID: 7348 RVA: 0x0008CC1F File Offset: 0x0008AE1F
		// (set) Token: 0x06001CB5 RID: 7349 RVA: 0x0008CC27 File Offset: 0x0008AE27
		public byte[] HeadBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ContentBytes" />
		// Token: 0x170005AD RID: 1453
		// (get) Token: 0x06001CB6 RID: 7350 RVA: 0x0008CC30 File Offset: 0x0008AE30
		// (set) Token: 0x06001CB7 RID: 7351 RVA: 0x0008CC38 File Offset: 0x0008AE38
		public byte[] ContentBytes { get; set; }

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.AdsNetMessage.CheckHeadBytesLegal(System.Byte[])" />
		// Token: 0x06001CB8 RID: 7352 RVA: 0x0008CC44 File Offset: 0x0008AE44
		public bool CheckHeadBytesLegal(byte[] token)
		{
			bool flag = this.HeadBytes == null;
			return !flag;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetContentLengthByHeadBytes" />
		// Token: 0x06001CB9 RID: 7353 RVA: 0x0008CC68 File Offset: 0x0008AE68
		public int GetContentLengthByHeadBytes()
		{
			byte[] headBytes = this.HeadBytes;
			bool flag = headBytes != null && headBytes.Length >= 6;
			int result;
			if (flag)
			{
				result = BitConverter.ToInt32(this.HeadBytes, 2);
			}
			else
			{
				result = 0;
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetHeadBytesIdentity" />
		// Token: 0x06001CBA RID: 7354 RVA: 0x00047BE1 File Offset: 0x00045DE1
		public int GetHeadBytesIdentity()
		{
			return 0;
		}

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.SendBytes" />
		// Token: 0x170005AE RID: 1454
		// (get) Token: 0x06001CBB RID: 7355 RVA: 0x0008CCA3 File Offset: 0x0008AEA3
		// (set) Token: 0x06001CBC RID: 7356 RVA: 0x0008CCAB File Offset: 0x0008AEAB
		public byte[] SendBytes { get; set; }
	}
}
